<!--补资料"-->
<template>
  <div>
    <el-form :model="checkForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="办理结果" prop="approveStatus"  :rules="[{ required: true, message: '请选择办理结果', trigger: 'change' }]">
        <el-radio-group v-model="checkForm.approveStatus">
          <el-radio label="9" class="red">按要求补充完毕</el-radio>
          <el-radio label="3" class="red">不按要求补充退件</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm(checkForm)" v-loading="loading">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { fillMaterial } from '@/api/project';
export default {
   props: {
     projectId: undefined,
     taskId: undefined
  },
  data() {
    return {
      checkForm: {
        approveStatus: undefined,
        projectId: undefined,
      },
      loading: false
    };
  },

  methods: {
    submitForm() {
      if (this.checkForm.approveStatus == undefined) {
        this.$message.error('请选择办理结果！');
        return;
      }
      this.checkForm.projectId = this.projectId,
      this.checkForm.taskId = this.taskId,
      this.$confirm('你确定要提交吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }).then(() => {
        this.loading = true;
        // 开始提交信息
        fillMaterial(this.checkForm).then((data) => {
          this.loading = false;
               this.$notify.success({
                title: '成功',
                message: '操作成功'
              })
          this.$store.dispatch("tagsView/delView", this.$route);
          this.$router.go(-1);
        }).catch(() => {
          this.loading = false;
        })
      });
    },
  },
};
</script>
